package ru.autofan.logic;

import java.util.HashMap;
import java.util.Map;

import ru.autofan.domain.CarFoto;
import ru.autofan.view.CarFotoBean;

public class CarFotoService extends BasicService {

	public CarFotoBean getCar(Long id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", id);
		CarFoto foto = getDaoSupporter().getUniqueObject(CarFoto.class, 
				"from CarFoto where id=:id", params);
		if (foto == null) {
			return null;
		}
		CarFotoBean bean = new CarFotoBean();
		bean.setData(foto.getData());
		bean.setFotoType(foto.getType());
		
		return bean;
	}

}
